 <?php 

$background = get_the_post_thumbnail_url();
if ( empty( $background ) ) { 
  $background = get_field('default_image', 'options')['url'];
}
 
 get_header();?>
 
 <section class="wrapper" style="background: #fff url(<?php if ( !empty( $background ) ) echo $background; ?>) no-repeat; background-size: 100% auto; background-size: cover;">
  <div class="container container-services">
    
    <div class="col-sm-12">

      <div class="page-container">

        <div class="row">

          <div class="col-md-8">

          <div class="inner-page-title">
            <h1><?php printf( esc_html__( 'Search Results for: %s', 'panoply' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
          </div>

            <?php if ( have_posts() ) : ?>

            <?php /* Start the Loop */ ?>
            <?php while ( have_posts() ) : the_post(); ?>

              <?php

                /*
                * Include the Post-Format-specific template for the content.
                * If you want to override this in a child theme, then include a file
                * called content-___.php (where ___ is the Post Format name) and that will be used instead.
                */
                get_template_part( 'template-parts/content','search');
              ?>

            <?php endwhile; ?>

            <?php the_posts_pagination(array(
                  'prev_text' => __( 'Prev', 'panoply' ),
                  'next_text' => __( 'Next', 'panoply' ),
              )); ?>

            <?php else : ?>

            <?php get_template_part( 'template-parts/content', 'none' ); ?>

            <?php endif; ?>

          </div>
    
        </div>

      </div>
      
    </div>
    
  </div>
    
  <?php get_template_part( 'inc/footer', 'contact' ); ?>
</section>

<?php get_footer('fp');?>